package com.boss;

import java.util.concurrent.CountDownLatch;

/**
 * @ClassName BThread
 * @Description
 * @Author xinggh
 * @Date 2020/8/14 14:28
 * @Version 1.0
 **/
public class BThread {

    public static void main(String[] args) {


        Thread a = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("A 执行");
            }
        });
        Thread b = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    a.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("B 执行完毕");
            }
        });
        Thread c = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    b.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("c 执行");

            }
        });

        a.start();
        b.start();
        c.start();
    }
}
